<html>

<head>
    <title>Create a new project</title>
    <script type="module">
        import { store } from "/components/projects/projects-store.js";
    </script>
</head>

<body>
    <div x-data>
        <template x-if="$store.projects && $store.projects.selectedProject">
            <div>
                <!-- <div class="project-detail-header">
                        <div class="projects-project-card-title">Project details</div>
                        <div class="project-path" x-text="$store.projects.selectedProject.path"></div>
                    </div> -->


                <div class="projects-setting-row" style="padding: 1rem 0;">
                    <div class="projects-setting-text">
                        <label class="projects-form-label">Inject project structure into context window</label>
                        <span class="projects-form-description">When turned on, the project file structure will be
                            injected into the context window of the agent. This is useful for agents that need to
                            have an overview of project folders and files at all times.</span>
                    </div>
                    <div class="projects-setting-control">
                        <label class="toggle">
                            <input type="checkbox" x-model="$store.projects.selectedProject.file_structure.enabled">
                            <span class="toggler"></span>
                        </label>
                    </div>
                </div>

                <div x-show="$store.projects.selectedProject.file_structure.enabled">


                    <div class="projects-form-group">
                        <label class="projects-form-label">Max Depth</label>
                        <span class="projects-form-description">Set the maximum depth for the file structure (0 =
                            unlimited).</span>
                        <input type="number" class="projects-form-input"
                            x-model.number="$store.projects.selectedProject.file_structure.max_depth" min="0" step="1"
                            placeholder="0">
                    </div>

                    <div class="projects-form-group">
                        <label class="projects-form-label">Max Lines</label>
                        <span class="projects-form-description">Maximum total lines outputted for the agent. This limits
                            the
                            space occupied in the context window (0 = unlimited).</span>
                        <input type="number" class="projects-form-input"
                            x-model.number="$store.projects.selectedProject.file_structure.max_lines" min="0" step="1"
                            placeholder="0">
                    </div>

                    <div class="projects-form-group">
                        <label class="projects-form-label">Max Folders</label>
                        <span class="projects-form-description">Maximum number of subfolders to display under one folder
                            (0 =
                            unlimited).</span>
                        <input type="number" class="projects-form-input"
                            x-model.number="$store.projects.selectedProject.file_structure.max_folders" min="0" step="1"
                            placeholder="0">
                    </div>

                    <div class="projects-form-group">
                        <label class="projects-form-label">Max Files</label>
                        <span class="projects-form-description">Maximum number of files to display under one folder (0 =
                            unlimited).</span>
                        <input type="number" class="projects-form-input"
                            x-model.number="$store.projects.selectedProject.file_structure.max_files" min="0" step="1"
                            placeholder="0">
                    </div>

                    <div class="projects-form-group">
                        <label class="projects-form-label">Ignored files / folders</label>
                        <span class="projects-form-description">Specify patterns in gitignore format. These files and
                            folders will be skipped during analysis, such as meta folders, cache directories, packages,
                            and
                            build artifacts.</span>
                        <textarea class="projects-form-textarea"
                            x-model="$store.projects.selectedProject.file_structure.gitignore" rows="5"
                            placeholder="Enter gitignore patterns (e.g., node_modules/, .git/, *.log)"></textarea>
                    </div>

                    <button class="button icon-button" x-on:click="$store.projects.testFileStructure()">
                        <span class="icon material-symbols-outlined">account_tree</span>
                        <span>Test output</span>
                    </button>


                </div>

            </div>
        </template>
    </div>
</body>
<style>
</style>

</html>